package com.yangyang.ralearn.message;

import org.apache.log4j.Logger;
import org.jboss.netty.channel.Channel;

import com.yangyang.ralearn.net.message.AbstractRespMessage;
import com.yangyang.ralearn.net.message.Message;
import com.yangyang.ralearn.net.message.MessageId;
import com.yangyang.ralearn.net.serialize.AutoSerializable;

@Message(id = MessageId.RESP_CANDO)
public class RespCanDoMessage extends AbstractRespMessage {

	@AutoSerializable(index = 1)
	private String action = "";
	@AutoSerializable(index = 2)
	private byte result;

	public void init(String action, byte result) {
		this.action = action;
		this.result = result;
	}

	public byte getResult() {
		return result;
	}

	@Override
	public void onGetServerMessage(int groupId, int simulatorId, Channel channel) {
		// TODO Auto-generated method stub
		Logger.getLogger(RespCanDoMessage.class).debug(action);
		Logger.getLogger(RespCanDoMessage.class).debug(result);
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
